package com.zl.test.tika;

import java.io.File;
import java.io.IOException;

import org.apache.tika.Tika;
import org.apache.tika.exception.TikaException;
import org.junit.Test;

public class TikaParser {

	@Test
	public void test() throws IOException, TikaException {
		Tika tika = new Tika();
		String[] files={
				"C:/Users/zhangle/Desktop/2017民办小学招生计划.pdf",
				"C:/Users/zhangle/Desktop/2017年广州市民办小学招生网上报名家长操作指南.doc",
				"C:/Users/zhangle/Desktop/天使娱乐第一期开发任务.xlsx"
		};
		
		for (String file : files) {
			String text = tika.parseToString(new File(file));
			System.out.println(text);
			System.out.println("========================================================");
		}
	}
}
